/*const http = require('http');
const zlib = require('zlib');
const fs = require('fs');
const querystring = require('querystring');
const analysis = require('./analysis');

process.on('uncaughtException', function (err) {
	console.log(err);
});

global.http_get = function(opt, callback) {
	http.get(opt, function(res) {
		var chunks = [], encoding = res.headers['content-encoding'];
		if(encoding === 'undefined') res.setEncoding('utf-8');
		res.on('data', function (chunk){
			chunks.push(chunk);
		});
		res.on('end', function (){
			var buffer = Buffer.concat(chunks);
			if (encoding == 'gzip') {
				zlib.gunzip(buffer, function (err, decoded) {
					callback(decoded.toString(), res.headers);
				});
			} else if (encoding == 'deflate') {
				zlib.inflate(buffer, function (err, decoded) {
					callback(decoded.toString(), res.headers);
				});
			} else {
				callback(buffer.toString(), res.headers);
			}
		});
	});
};

global.http_post = function(opt, params, callback) {
	var data = "";
	if (params) data = querystring.stringify(params);
	if (!opt.headers) opt.headers = { };
	opt.headers['Content-Length'] = Buffer.byteLength(data);
	var req = http.request(opt, function(res) {
		var chunks = [], encoding = res.headers['content-encoding'];
		if(encoding === 'undefined') res.setEncoding('utf-8');
		res.on('data', function (chunk){
			chunks.push(chunk);
		});
		res.on('end', function (){
			var buffer = Buffer.concat(chunks);
			if (encoding == 'gzip') {
				zlib.gunzip(buffer, function (err, decoded) {callback(decoded.toString());});
			} else if (encoding == 'deflate') {
				zlib.inflate(buffer, function (err, decoded) {callback(decoded.toString());});
			} else {
				callback(buffer.toString());
			}
		});
	});
	req.write(data);
	req.end();
};

global.es = {
	source:{ ip: "172.30.1.78:9200", verison:"1.6"},
	current:{ ip: "172.30.1.78:9200", verison:"5.0"},
};

new analysis(__dirname + "\\base\\案件编号.js");*/
/*
let filePath = __dirname + `\\base\\`;
fs.readdir(filePath, function(err,files){
	if(err) return;
	var count = files.length;
	files.forEach(function(filename){
		new analysis(filePath + filename);
	});
});
*/


